export interface LayersType {
  [key: string]: string | LayersType
}
export const GenerateStoreName = function (
  target: LayersType,
  key: string,
  idx: number = 0
): string {
  if (Object.prototype.hasOwnProperty.call(target, key + (idx === 0 ? '' : '_' + idx))) {
    idx++
    return GenerateStoreName(target, key + '_' + idx)
  } else {
    return idx === 0 ? key : key + '_' + idx
  }
}
